package com.haulmont.asu.web.ui.work;

import com.haulmont.cuba.gui.WindowManager;
import com.haulmont.cuba.gui.components.AbstractLookup;
import com.haulmont.cuba.gui.components.Table;
import com.haulmont.cuba.gui.components.actions.CreateAction;
import com.haulmont.cuba.gui.components.actions.EditAction;

import javax.inject.Inject;
import java.util.Map;

/**
 * Author: Sergey42
 * Date: 14.11.13 12:57
 */
public class WorkBasicBrowser extends AbstractLookup {

    @Inject
    protected Table worksTable;

    @Override
    public void init(Map<String, Object> params) {
        super.init(params);

        worksTable.removeAction(getAction("worksTable.create"));
        worksTable.addAction(new CreateAction(worksTable, WindowManager.OpenType.DIALOG));

        worksTable.removeAction(getAction("worksTable.create"));
        worksTable.addAction(new EditAction(worksTable, WindowManager.OpenType.DIALOG));
    }
}
